cmake_minimum_required(VERSION 3.8)  
project(person_detection_cpp)  

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")  
  add_compile_options(-Wall -Wextra -Wpedantic)  
endif()  

find_package(ament_cmake REQUIRED)  
find_package(rclcpp REQUIRED)  
find_package(sensor_msgs REQUIRED)  
find_package(cv_bridge REQUIRED)  
find_package(OpenCV REQUIRED)  
find_package(recognition_interface REQUIRED)

# 服务器可执行文件  
add_executable(person_detection_server src/person_detection_server.cpp)  
ament_target_dependencies(person_detection_server  
  rclcpp  
  sensor_msgs  
  cv_bridge  
  OpenCV    
  recognition_interface
)  

# 客户端可执行文件  
add_executable(person_detection_client src/person_detection_client.cpp)  
ament_target_dependencies(person_detection_client  
  rclcpp  
  sensor_msgs  
  cv_bridge  
  OpenCV    
  recognition_interface
)  

install(TARGETS  
  person_detection_server  
  person_detection_client  
  DESTINATION lib/${PROJECT_NAME}  
)  

ament_package()
